/**
 * 
 */
package com.google.code.cisx.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @version $Id: CommonUpdatableEntity.java 2 2007-12-15 09:46:32Z
 *          rahul.thakur.xdev $
 */
@MappedSuperclass
public abstract class CommonUpdatableEntity extends CommonCreatedEntity {

  /**
   * Date the entity was last updated.
   */
  @Temporal(TemporalType.TIMESTAMP)
  @Column(name = "DATE_UPDATED")
  private Date dateUpdated;

  /**
   * Version for optimistic locking.
   */
  @Version
  @Column(name = "OBJ_VERSION")
  private Long objectVersion;

  /**
   * @return the dateUpdated
   */
  public Date getDateUpdated() {
    return dateUpdated;
  }

  /**
   * @param dateUpdated
   *          the dateUpdated to set
   */
  public void setDateUpdated(Date dateUpdated) {
    this.dateUpdated = dateUpdated;
  }

  /**
   * @return the version
   */
  public Long getObjectVersion() {
    return objectVersion;
  }

  /**
   * @param version
   *          the version to set
   */
  public void setObjectVersion(Long version) {
    this.objectVersion = version;
  }

}
